<?php
	
	require_once("fta.201003310000/fta.php");
	fta_registerModules(
		array(
		"cms.201003310000/config/cmsConfig",//we will deprecate the old cms config soon..
		"site/components/MAIClasses",
		"FTAWebPage/ftaDefaultWidgets",
        "FTAWebPage/FTAWebPage",
        "FTAEvents/FTAEvents",
        "site/components/MAIEvent"
	));	
	        
    global $FTAWebPageDocumentType;
    $FTAWebPageDocumentType = 'docWebSnip';
    
	$classType = extractStringWithKeyFromArray("classType", $_REQUEST, null);
	//Need to default it to top one if not set or another page.
	if(is_null($classType)){
		header('location: /Classes/');
	} else {
		$classType = "/" . $classType . "/";
	}
	
	//need to redirect if no type found
	$o = mai_getSharedClassesObject();
	if($o->getClassTypeByUrl($classType) == false){
		header('location: /Classes/');
	}
	//echo "Class Url = $classType <br />Object = <pre>"; print_r($o->getClassTypeByUrl($classType)); echo "</pre>";
	//echo "<pre>"; print_r($o->getClassGroupsForType($classType)); echo "</pre>";
	//$o->renderClassTabs($classType);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo mai_renderMetaDataKeywords($classType); ?>" />
<meta name="Description" content="<?php echo mai_renderMetaDataDescription($classType); ?>" />

<title><?php echo mai_renderPageTitle($classType); ?></title>

<?php include ("includes/external-files.php"); ?>

<? /*
<script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.72.js"></script>
<script type="text/javascript">
$(function() {
    
    $('#s4').cycle({
        fx:     'scrollDown',
        speed:  'slow',
        timeout: 0,
		pager:  '.anchor-nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.anchor-nav li:eq(' + (idx) + ') a';
        }
		});
});

</script>
*/ ?>



<?php include ("includes/analytics.php"); ?>   
</head>

<body id="classes" class="class-lists">



<?php include ("includes/head.php"); ?>





<div id="container">


	<div id="content">
    	

         
        
        <div id="content-blocks">
        <h1><a href="/Classes/"><?php echo mai_renderPageHeading($classType); ?></a></h1>

        <h2><?php echo mai_renderIntro($classType); ?></h2>
        
        <?php echo mai_renderClassList($classType); ?>
        

		</div><!-- Content-blocks ends -->
        
    
    
    
   </div><!-- Content ends -->


    
    
    





    
    
	<?php include ("includes/classesSubNav.php"); ?><!-- Sub-nav ends -->



    
</div><!-- Container ends -->




<?php  include ("includes/foot.php"); ?>


<script>
// Tab switching
	$(document).ready(function() {
	 
		//Default Action
		$(".content-block").hide(); //Hide all content
		$("ul.anchor-nav li:first").addClass("active").show(); //Activate first tab
		$(".content-block:first").show(); //Show first tab content
		
		//On Click Event
		$("ul.anchor-nav li").click(function() {
			$("ul.anchor-nav li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".content-block").hide(); //Hide all tab content
			var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active content
			return false;
		}); 
	});
</script>


</body>

</html>
